<%-- 
    Document   : manageProductCategory
    Created on : Sep 26, 2013, 2:29:44 PM
    Author     : Nguyen The Bao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:include page="header.jsp"/>
<script>
  function confirmDelete() {
    if (confirm("Bạn chắc chắn muốn xóa？")) {
      return true;
    } else {
      return false;
    }
  }
</script>
<div id="wrapper-page">
  <div class="function-wrap">
    <h2>Quản lý loại sản phẩm</h2>
    <a href="menuFunction.jsp" style="display:block;width:50px;" ><div class="btnbackMenu"></div></a>
    <div class="listProduct">
      <h3>Danh sách loại sản phẩm</h3>
      <div class="search">
        <form action="C_Category">
          <input style="padding-left:10px;width:200px; height:30px;" type="text" name="txtSearch" placeholder="Tên loại sản phẩm?"/>
          <input type="hidden" name="btAction" value="Pro_cate_Search" />
        </form>
      </div>
      <div class="list">
        <c:set var="info_pro_cate" value="${requestScope.INFO}"/>
        <c:if test="${not empty info_pro_cate}">
          <table style="width: 950px; border: 1px solid #dedede;">
            <tbody>
              <tr>
                <td>STT</td>
                <td>Tên loại sản phẩm</td>
                <td>Thêm</td>
                <td>Sửa</td>
                <td>Xóa</td>
              </tr>
              <c:set var="count" value="0"/>
              <c:forEach var="rows" items="${info_pro_cate}">
                <c:set var="count" value="${count+1}"/>
                <tr>
                  <td>${count}</td>
                  <td>${rows.tenloaisp}</td>
                  <c:url var="details_insert" value="C_Category">
                    <c:param name="btAction" value="Pro_cate_Details_Insert"/>
                  </c:url>
                  <td>
                    <a href="${details_insert}">
                      <img src="./skin/images/insert.png" width="20" style="float:left;"/>
                    </a>
                  </td>
                  <c:url var="details_update" value="C_Category">
                    <c:param name="btAction" value="Pro_cate_Details_Update"/>
                    <c:param name="maloaisp" value="${rows.maloaisp}"/>
                  </c:url>
                  <td><a href="${details_update}">
                      <img src="./skin/images/update.png" width="20" style="float:left;"/>
                    </a></td>
                    <c:url var="delete" value="C_Category">
                      <c:param name="btAction" value="Pro_cate_Delete"/>
                      <c:param name="product_cate_id" value="${rows.maloaisp}"/>
                      <c:param name="txtSearch" value="${param.txtSearch}"/>
                    </c:url>
                  <td><a onclick="return confirmDelete()" href="${delete}">
                      <img src="./skin/images/deletered.png" width="20" style="float:left;"/>
                    </a>
                  </td>
                </tr>        
              </c:forEach>
            </tbody>
          </table>
        </c:if>
      </div>
    </div>  
    <c:set var="dt" value="${requestScope.DETAILS}"/>
    <c:if test="${not empty dt}">                  
      <div class="listProduct">
        <h3>Thông tin chi tiết</h3>
        <div style="width: 226px;margin: 0 auto;margin-bottom: 20px;">

          <table>
            <tbody>                  
              <tr>
                <td>Tài khoản:</td>
                <td><input class="inputLog" type="text" value="${dt.tenloaisp}"/></td>
              </tr>           
            </tbody>
          </table>

        </div>
      </div>  
    </c:if>
  </div>      
</div>              
</body>
</html>
